<?php

class IndexpageModule extends fvModule {

    function __construct () {
        $moduleName = strtolower(substr(__CLASS__, 0, -6));

        parent::__construct(fvSite::$fvConfig->get("modules.{$moduleName}.smarty.template"), 
                            fvSite::$fvConfig->get("modules.{$moduleName}.smarty.compile"), 
                            fvSite::$Layoult);
    }

    function showIndex() {
    	if (!file_exists(INDEX_PAGE_FILE.'_'.fvSite::$fvSession->get("lang"))){
    		touch(INDEX_PAGE_FILE.'_'.fvSite::$fvSession->get("lang")); 
    	}
    	$index_page = base64_decode(file_get_contents(INDEX_PAGE_FILE.'_'.fvSite::$fvSession->get("lang")));
    	$editor = new fvCKEditor();
        $this->__assign(array(
            'editor' => $editor->editor("description", "description", $index_page),
        ));
        return $this->__display('indexpage_edit.tpl');    
    }
    
}

?>
